<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <script src="jQuery.min.js"></script>
    <title>本地储存的数据格式</title>
</head>
<body>
    <script>
        var todolist = [{
            title:'温度计',
            done:false
        },{
            title:'学jQuery',
            done:false
        },]
        // localStorage.setItem('todo',todolist)
        // 1 . 本地存储里面只能存储字符串的数据格式 所以要把数组对象转换为字符串格式
        localStorage.setItem('todo',JSON.stringify(todolist))

        var data = localStorage.getItem('todo')
        // 2.获取本地存储数据 需要把里面的字符串数据转换为 对象格式 JSON.parse()
        data = JSON.parse(data)
        console.log(data);
    </script>
</body>
</html>